/*     */ package com.qmsk.business.info.carLesson.controller;
/*     */ 
/*     */ import com.qmsk.business.info.carLesson.dao.CarLessonDAO;
/*     */ import com.utils.basic.MapUtils;
/*     */ import com.utils.gson.out.GsonEbRst;
/*     */ import com.utils.web.RequestUtils;
/*     */ import com.utils.web.ResponseUtils;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ import org.apache.log4j.Logger;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/carLesson"})
/*     */ public class CarLessonController
/*     */ {
/*  26 */   private static final Logger logger = Logger.getLogger(CarLessonController.class);
/*     */ 
/*     */   @Autowired
/*     */   private CarLessonDAO dao;
/*     */ 
/*     */   @RequestMapping(value={"find/adList/{pageIdx}/{pageSize}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getListOptShopId(HttpServletRequest request, HttpServletResponse response, @PathVariable("pageIdx") Integer nPageIdx, @PathVariable("pageSize") Short nPageSize)
/*     */   {
/*  34 */     nPageSize = RequestUtils.getRequestValidPageSize(nPageSize);
/*     */     try {
/*  36 */       Map params = new HashMap();
/*  37 */       MapUtils.addToMap(params, "status", Integer.valueOf(0));
/*  38 */       MapUtils.addPercentToMap(params, "title", RequestUtils.getString(request, "title"));
/*  39 */       String shopId = RequestUtils.getString(request, "shopId");
/*  40 */       MapUtils.addToMap(params, "shopId", shopId);
/*  41 */       MapUtils.addToMap(params, "typeId", 
/*  42 */         RequestUtils.getString(request, "typeId"));
/*  43 */       MapUtils.addToMap(params, "keyWord2", 
/*  44 */         RequestUtils.getString(request, "keyWord"));
/*  45 */       GsonEbRst gsonEbRst = this.dao.getGsonOfAll(params, nPageIdx, nPageSize);
/*  46 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*     */     } catch (Exception e) {
/*  48 */       logger.error(e);
/*  49 */       ResponseUtils.setErrorMsgResponse(
/*  50 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @RequestMapping(value={"find/adList"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getListOptShopId(HttpServletRequest request, HttpServletResponse response) {
/*     */     try {
/*  57 */       Map params = new HashMap();
/*  58 */       MapUtils.addToMap(params, "status", Integer.valueOf(0));
/*  59 */       String shopId = RequestUtils.getString(request, "shopId");
/*  60 */       MapUtils.addToMap(params, "shopId", shopId);
/*  61 */       MapUtils.addToMap(params, "typeId", 
/*  62 */         RequestUtils.getString(request, "typeId"));
/*     */ 
/*  64 */       GsonEbRst gsonEbRst = this.dao.getGsonOfAll(params);
/*  65 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*     */     } catch (Exception e) {
/*  67 */       logger.error(e);
/*  68 */       ResponseUtils.setErrorMsgResponse(
/*  69 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @RequestMapping(value={"find/carLessonById"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getcarLessonById(HttpServletRequest request, HttpServletResponse response) {
/*     */     try {
/*  76 */       Map params = new HashMap();
/*  77 */       MapUtils.addToMap(params, "status", Integer.valueOf(0));
/*  78 */       MapUtils.addToMap(params, "id", 
/*  79 */         RequestUtils.getString(request, "id"));
/*     */ 
/*  81 */       GsonEbRst gsonEbRst = this.dao.getGsonOfAll(params);
/*  82 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*     */     } catch (Exception e) {
/*  84 */       logger.error(e);
/*  85 */       ResponseUtils.setErrorMsgResponse(
/*  86 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @RequestMapping(value={"find/typeList"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void getListType(HttpServletRequest request, HttpServletResponse response)
/*     */   {
/*     */     try {
/*  94 */       Map params = new HashMap();
/*  95 */       MapUtils.addToMap(params, "status", Integer.valueOf(0));
/*  96 */       String shopId = RequestUtils.getString(request, "shopId");
/*  97 */       MapUtils.addToMap(params, "shopId", shopId);
/*  98 */       MapUtils.addToMap(params, "typeId", 
/*  99 */         RequestUtils.getString(request, "typeId"));
/*     */ 
/* 101 */       GsonEbRst gsonEbRst = this.dao.getGsonOfAllKeyWord(params);
/* 102 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*     */     } catch (Exception e) {
/* 104 */       logger.error(e);
/* 105 */       ResponseUtils.setErrorMsgResponse(
/* 106 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @RequestMapping(value={"update/num/{id}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void update(HttpServletRequest request, HttpServletResponse response, @PathVariable("id") Long id)
/*     */   {
/*     */     try
/*     */     {
/* 118 */       int nResult = 0;
/* 119 */       nResult = this.dao.updateNumber(id);
/* 120 */       if (nResult > 0) {
/* 121 */         this.dao.commit();
/*     */ 
/* 127 */         ResponseUtils.setSuccessResponse(response);
/* 128 */         return; }
/* 129 */       this.dao.rollback();
/* 130 */       ResponseUtils.setErrorMsgResponse(
/* 131 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 135 */       this.dao.rollback();
/* 136 */       logger.error(e);
/* 137 */       ResponseUtils.setErrorMsgResponse(
/* 138 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ 
/*     */   @RequestMapping(value={"find/typeNameById"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*     */   public void typeNameById(HttpServletRequest request, HttpServletResponse response)
/*     */   {
/*     */     try {
/* 146 */       Long id = RequestUtils.getLong(request, "id");
/*     */ 
/* 148 */       GsonEbRst gsonEbRst = this.dao.selectCarlessonTypeById(id);
/* 149 */       ResponseUtils.setResponseResult(gsonEbRst, response);
/*     */     } catch (Exception e) {
/* 151 */       logger.error(e);
/* 152 */       ResponseUtils.setErrorMsgResponse(
/* 153 */         RequestUtils.getFindDataErrorMessage(request), response);
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.info.carLesson.controller.CarLessonController
 * JD-Core Version:    0.5.3
 */